//输入coin,coin总数，产品价格，折扣
biz_calc_coin=function(current_coin,max_coin,price,discount){

    if(current_coin==''){
        current_coin=0;
    }

    //不能超过最大值
    if(current_coin>max_coin){
        current_coin=max_coin;
    }

    var exchange_money=current_coin * 100;

    //不能超过商品价格
    if(exchange_money>price *100){
        current_coin=parseInt(price);
        exchange_money=current_coin * 100;
    }
    //alert((1-discount));
    //debugger;
    var realPrice=(price *100-exchange_money)  * (100-discount*100) / 10000;
    exchange_money=exchange_money / 100;

    return {
        current_coin:current_coin,
        exchange_money:exchange_money,
        realPrice:realPrice
    };


}